import { get, post } from '@/utils/request'

// 获取聊天信息列表数据
export const homeDataApi = async (params) => {
  let apiPath = '';

  // 根据参数选择不同的API路径
  switch (params) {
    case 'category':
      apiPath = '/api/category';
      break;
    case 'hitshow':
      apiPath = '/api/hitshow';
      break;
    case 'hotArtist':
      apiPath = '/api/hotArtist';
      break;
    case 'selecTedopic':
      apiPath = '/api/selecTedopic';
      break;
    default:
      // 参数无效，返回空数组或其他默认数据
      return [];
  }

  // 发送GET请求，并传递构建的API路径
  const response = await get(apiPath);

  // 返回获取到的数据
  return response.data;
}


